﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Utils;

#endregion

namespace Sebarf.Tests {
	/// <summary>
	/// Description of the class
	/// </summary>
	[TestClass]
	public class TestProcessStep {
		#region Public Methods

		[TestMethod]
		public void SquareRoot() {
			// create process step one
			var step1 = new SquareRootProcessStep();
			// define next step
			step1.NextStep = new NegateProcessStep();

			// execute process chain
			Assert.AreEqual(50 * 50 * -1, Convert.ToDouble(step1.Process(50)));
		}

		#region Nested type: NegateProcessStep

		public class NegateProcessStep : ProcessStep<Double> {
			protected override double OnProcess(double toProcess) {
				return toProcess * -1;
			}
		}

		#endregion

		#region Nested type: SquareRootProcessStep

		public class SquareRootProcessStep : ProcessStep<Double> {
			protected override double OnProcess(double toProcess) {
				return toProcess * toProcess;
			}
		}

		#endregion

		#endregion
	}
}